Skip to content

feat(ui): cross-platform confirm dialog (fix Alert.alert no-op on web)#67

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/cross-platform-confirm
Jun 1, 2026
Merged

feat(ui): cross-platform confirm dialog (fix Alert.alert no-op on web)#67
xuyushun441-sys merged 1 commit into
mainfrom
feat/cross-platform-confirm

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Problem

Alert.alert renders nothing on React Native Web — its confirm buttons never fire. So every confirmation was a silent no-op in the web build: record delete, sign out, package uninstall, the new state-machine transition, and the object-action confirmText prompt. Notification-style alerts (upload/account/required-field errors) also never appeared.

Fix

  • ConfirmProvider + useConfirm() — a promise-based confirm backed by the Dialog/Modal primitives, working identically on web and native. Wired into the root layout.
  • Replaced all confirm-style Alert.alert with useConfirm: record delete (detail + list), sign out (more + profile), package uninstall, state transition, and the action confirmText prompt in useRecordActions.
  • Replaced notification-style Alert.alert with toasts: delete/upload failures, account success/error, action required-field message.
  • No Alert.alert references remain in app/, components/, hooks/.

Verification

  • ✅ In-browser against a local 7.5.0 server: advancing crm_opportunity now shows a real 更新状态 confirm dialog (取消 / 确认, localized); confirming applies the transition (proposal → negotiation) and re-highlights the diagram — previously impossible on web.
  • ✅ New useConfirm tests (resolves true on confirm / false on cancel); tsc + eslint clean (one pre-existing unrelated warning); full suite 1130 pass (20 pre-existing snapshot failures, unrelated).

This resolves the limitation flagged in #66.

🤖 Generated with Claude Code

Alert.alert renders nothing on React Native Web — its confirm buttons never
fire — so every confirmation (delete, sign out, uninstall, state transition,
action confirmText) was a silent no-op in the web build, and notification
alerts (upload/account/required-field errors) never showed.

- Add ConfirmProvider + useConfirm(): a promise-based confirm backed by the
  Dialog/Modal primitives, so it works identically on web and native. Wired
  into the root layout.
- Replace all confirm-style Alert.alert with useConfirm: record delete (detail
  + list), sign out (more + profile), package uninstall, state transition, and
  the object-action confirmText prompt in useRecordActions.
- Replace notification-style Alert.alert with toasts: delete/upload failures,
  account success/error, and the action required-field message.

Verified in-browser against a local 7.5.0 server: advancing crm_opportunity
now shows a real "更新状态" confirm dialog, and confirming applies the
transition (stage proposal → negotiation) and re-highlights the diagram —
previously impossible on web. Adds useConfirm tests; typecheck + lint clean;
full suite green apart from the pre-existing snapshots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xuyushun441-sys xuyushun441-sys merged commit b4588d0 into main Jun 1, 2026
1 of 4 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/cross-platform-confirm branch June 1, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants